-- GENERATED SPELL FOR [The Black Stalker] --


function spell0_17882(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(31717,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17882', 3000, 1)
end

function spell1_17882(pUnit, Event) --@Levitate,n/a--
pUnit:FullCastSpellOnTarget(31704,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17882', 6000, 1)
end

function spell2_17882(pUnit, Event) --@Static Charge,n/a--
pUnit:FullCastSpellOnTarget(31715,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17882', 12000, 1)
end

function Sorts_17882(pUnit, Event)
local choix_sorts_17882 = math.random(0, 2)
if choix_sorts_17882 == 0 then
pUnit:RegisterEvent('spell0_17882', 1, 1)
end
if choix_sorts_17882 == 1 then
pUnit:RegisterEvent('spell1_17882', 1, 1)
end
if choix_sorts_17882 == 2 then
pUnit:RegisterEvent('spell2_17882', 1, 1)
end
end

function mob17882_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17882', math.random(1500, 3000), 1)
end

function mob17882_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17882_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17882_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17882, 1, 'mob17882_Action')
RegisterUnitEvent(17882, 2, 'mob17882_Leave')
RegisterUnitEvent(17882, 3, 'mob17882_Kill')
RegisterUnitEvent(17882, 4, 'mob17882_Die')
